from PyQt5.Qt import *
import sys

class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.resize(600,450)
        self.move(300,300)
        self.addBtn()

    def addBtn(self):
        btn = QPushButton(self)
        btn.setText('点击按钮0')
        btn.clicked.connect(self.btnClick)

        btn1 = QPushButton(self)
        btn1.setText('点击按钮1')
        btn1.move(100,100)
        btn1.clicked.connect(self.btnClick)

    btnsclick = pyqtSignal([int],[str,int])
    def btnClick(self):
        print('你点击了我')
        self.setStyleSheet("""
        background-color:red;
        """)
        self.btnsclick[int].emit('hello')
        # self.btnsclick[str,int].emit('hello',22)



if __name__ == '__main__':
    app = QApplication(sys.argv)
    w1 = Window()

    def show():
        print('000000')
    def show1(e):
        print('11111111')
    def show2(a,b):
        print(a,b)
    w1.btnsclick.connect(show)
    w1.btnsclick[str].connect(show1)
    w1.btnsclick[str,int].connect(show2)

    w1.show()
    sys.exit(app.exec_())


